package controller;
import java.sql.SQLException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import exception.MyException;
import service.TestExceptionService;
@Controller
//public class TestExceptionController extends BaseController{
public class TestExceptionController{
	@Autowired
	private TestExceptionService testExceptionService; 
	@GetMapping("/db")  
    public void db() throws Exception {  
        throw new SQLException("控制器中数据库异常");
    }  
	@GetMapping("/my")  
    public void my() throws Exception {  
        throw new MyException("控制器中自定义异常");
    }
	@GetMapping("/no")  
    public void no() throws Exception {  
        throw new Exception("控制器中未知异常");
    } 
	@GetMapping("/servicedb")  
    public void servicedb() throws Exception {  
    		testExceptionService.servicedb();;  
    }  
	@GetMapping("/servicemy")  
    public void servicemy() throws Exception {  
    		testExceptionService.servicemy();  
    }  
	@GetMapping("/serviceno")  
    public void serviceno() throws Exception {  
    		testExceptionService.serviceno();  
    } 
	@GetMapping("/daodb")  
    public void daodb() throws Exception {  
    		testExceptionService.daodb();  
    } 
	@GetMapping("/daomy")  
    public void daomy() throws Exception {  
    		testExceptionService.daomy();  
    }  
	@GetMapping("/daono")  
    public void daono() throws Exception {  
    		testExceptionService.daono();  
    }   
}
